﻿<%@ Page Title="<%$ Concat:UIStrings.BackupRestore,' &raquo; ResourceBlender.NET' %>" Language="C#" MasterPageFile="~/Layout.master" AutoEventWireup="true" CodeFile="Backup.aspx.cs" Inherits="Backup" %>
<%@ Register TagPrefix="L49" Namespace="Lime49.UI" %>

<asp:Content ID="contentHead" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="contentMain" ContentPlaceHolderID="cntMain" Runat="Server">
    <asp:ScriptManager ID="scrRestore" runat="server">
    </asp:ScriptManager>
    <h1><asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:UIStrings, BackupRestore %>" Mode="Encode" /></h1>
    <div class="niceform">
        <asp:MultiView ID="mltMain" runat="server" ActiveViewIndex="0">
            <asp:View ID="viwBackupRestore" runat="server">
                <div class="breadcrumbs">
                    <asp:HyperLink ID="lnkNavHomeStep1" runat="server" NavigateUrl="~/Default.aspx">ResourceBlender.NET</asp:HyperLink> &gt; <asp:Literal ID="Literal2" runat="server" Mode="Encode" Text="<%$ Resources:UIStrings, BackupRestore %>" />
                </div>
                <fieldset>
                    <legend><asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:UIStrings, Backup %>" /></legend>
                    <strong><asp:Literal ID="Literal4" runat="server" Text="<%$ Resources:UIStrings, Include %>" /></strong>
                    <div class="checks plain">
                        <asp:CheckBox ID="chkBakApplications" runat="server" Text="<%$ Resources:UIStrings, Applications %>" 
                            ValidationGroup="backup" Checked="True" /><br />
                        <asp:CheckBox ID="chkBakElements" runat="server" Text="<%$ Resources:UIStrings, Elements %>" 
                            ValidationGroup="backup" Checked="True" /><br />
                        <asp:CheckBox ID="chkBakTemplates" runat="server" Text="<%$ Resources:UIStrings, Templates %>" 
                            ValidationGroup="backup" Checked="True" /><br />
                        <asp:CheckBox ID="chkBakResources" runat="server" Text="<%$ Resources:UIStrings, Resources %>" 
                            ValidationGroup="backup" Checked="True" /><br />
                        <asp:CheckBox ID="chkBakUsers" runat="server" Text="<%$ Resources:UIStrings, Users %>" 
                            ValidationGroup="backup" Checked="True" /><br />
                        <asp:Label ID="lblNoBackupOptions" runat="server" Text="<%$ Resources:UIStrings, NothingSelectedToBackup %>" CssClass="block error" Visible="false"></asp:Label>
                    </div>
                    <div class="actions">
                        <asp:Button ID="btnBackup" runat="server" Text="<%$ Resources:UIStrings, Backup %>" 
                            ValidationGroup="backup" CssClass="uniformbutton btnDownload" OnClick="btnBackup_Click" />
                    </div>
                </fieldset>
                
                <fieldset>
                    <legend><asp:Literal ID="Literal5" runat="server" Text="<%$ Resources:UIStrings, Restore %>" /></legend>
                    <strong><asp:Literal ID="Literal6" runat="server" Text="<%$ Resources:UIStrings, Include %>" /></strong>
                    <div class="checks plain">
                        <asp:CheckBox ID="chkResApplications" runat="server" Text="<%$ Resources:UIStrings, Applications %>" 
                            ValidationGroup="restore" Checked="True" /><br />
                        <asp:CheckBox ID="chkResElements" runat="server" Text="<%$ Resources:UIStrings, Elements %>" 
                            ValidationGroup="restore" Checked="True" /><br />
                        <asp:CheckBox ID="chkResTemplates" runat="server" Text="<%$ Resources:UIStrings, Templates %>" 
                            ValidationGroup="restore" Checked="True" /><br />
                        <asp:CheckBox ID="chkResResources" runat="server" Text="<%$ Resources:UIStrings, Resources %>" 
                            ValidationGroup="restore" Checked="True" /><br />
                        <asp:CheckBox ID="chkResUsers" runat="server" Text="<%$ Resources:UIStrings, Users %>" 
                            ValidationGroup="restore" Checked="True" /><br />
                    </div>
                    <asp:Label ID="lblBackupFile" runat="server" Text="<%$ Resources:UIStrings, FileToRestore %>" 
                        CssClass="block" AssociatedControlID="uplBackupfile"></asp:Label>
                    <asp:FileUpload ID="uplBackupfile" runat="server" />
                    <asp:Label ID="lblNoFileSelected" runat="server" Text="<%$ Resources:Errors, FileToRestoreRequired %>" CssClass="error" Visible="false"></asp:Label>
                    <br />
                    <div class="checks plain autowidth">
                        <asp:CheckBox ID="chkClearDatabase" runat="server" Text="<%$ Resources:UIStrings, ClearDatabaseDesc %>" 
                            ToolTip="<%$ Resources:UIStrings, ClearDatabaseWarning %>" ValidationGroup="restore" /><br />
                    </div>
                    <asp:Label ID="lblRestoreError" runat="server" CssClass="block error"></asp:Label>
                    <div class="actions">
                        <asp:Button ID="btnRestore" runat="server" Text="<%$ Resources:UIStrings, Restore %>" 
                            ValidationGroup="restore" CssClass="uniformbutton btnGo" OnClick="btnRestore_Click" />
                    </div>
                </fieldset>
            </asp:View>
            <asp:View ID="viwStartRestore" runat="server">
                <div class="breadcrumbs">
                    <asp:HyperLink ID="lnkNavHomeStep2" runat="server" NavigateUrl="~/Default.aspx">ResourceBlender.NET</asp:HyperLink> &gt; <asp:HyperLink ID="lnkNavBackup" runat="server" Mode="Encode" NavigateUrl="~/Backup.aspx" Text="<%$ Resources:UIStrings, BackupRestore %>"></asp:HyperLink>
                </div>
                <asp:UpdatePanel ID="updRestore" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Timer ID="tmrRestore" runat="server" Enabled="false" Interval="2500" OnTick="tmrRestore_Tick">
                        </asp:Timer>
                        <h3><asp:Literal ID="Literal7" runat="server" Text="<%$ Resources:UIStrings, Progress %>" /></h3>
                        <L49:FormattedList ID="lstProgress" runat="server">
                        </L49:FormattedList>
                        <asp:Image ID="imgProgress" runat="server" AlternateText="<%$ Resources:UIStrings, RestoringDatabase %>" ImageUrl="images/ajax-small.gif" Visible="false" CssClass="block centered" />
                        <asp:Button ID="btnStartRestore" runat="server" Text="<%$ Resources:UIStrings, Restore %>"
                            OnClick="btnStartRestore_Click" CssClass="uniformbutton btnGo" />
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="tmrRestore" EventName="Tick" />
                    </Triggers>
                </asp:UpdatePanel>
            </asp:View>
        </asp:MultiView>
    </div>
</asp:Content>

